FROM debian:8.5
MAINTAINER case0079 <79100984@qq.com>
ENV NEXUS_HOME /usr/local/nexus
ARG user=nexus
ARG group=nexus
ARG uid=1000
ARG gid=1000

RUN apt-get -qq update
RUN apt-get -qq -y install curl

RUN groupadd -g ${gid} ${group} \
&& useradd -d "$NEXUS_HOME" -u ${uid} -g ${gid} -m -s /bin/bash ${user}


WORKDIR /usr/local/nexus

USER ${user}



RUN curl -sO https://sonatype-download.global.ssl.fastly.net/nexus/oss/nexus-2.13.0-01-bundle.tar.gz
RUN tar -xzvf nexus-2.13.0-01-bundle.tar.gz

EXPOSE 8081


CMD ["/usr/local/nexus/nexus-2.13.0-01/bin/nexus", "console"]